/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykht.proj.coupon.entity.FxPersonAccount;
import com.ykht.proj.coupon.vo.FxPersonAccountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * c端账户表
 *
 * @author proj code generator
 * @date 2021-08-12 14:10:39
 */
@Mapper
public interface FxPersonAccountMapper extends BaseMapper<FxPersonAccount> {

	/**
	 * 分销收益有效给C端用户佣金
	 *
	 * @param personId      登录id(C端)
	 * @param type          0分销用户
	 * @param balance       可用余额
	 * @param balanceTotal  累计收益
	 * @param balanceFrozen 冻结金额
	 * @param withdrawal    累计提现金额
	 * @param updateUser    修改人
	 */
	void updateFxPersonAccount(@Param("personId") Long personId, @Param("type") Integer type, @Param("balance") BigDecimal balance
			, @Param("balanceTotal") BigDecimal balanceTotal, @Param("balanceFrozen") BigDecimal balanceFrozen
			, @Param("withdrawal") BigDecimal withdrawal, @Param("updateUser") Long updateUser);

	/**
	 * 分页查询 c端账户表
	 *
	 * @param page              分页对象
	 * @param fxPersonAccountVo c端账户表
	 * @return
	 */
    IPage<FxPersonAccountVo> getFxPersonAccountPage(Page page, @Param("req") FxPersonAccountVo fxPersonAccountVo);

	/**
	 * 分页查询 c端账户提现记录列表
	 *
	 * @param page              分页对象
	 * @param fxPersonAccountVo c端账户表
	 * @return
	 */
	IPage<FxPersonAccountVo> getCWithdrawalRecordPage(Page page, @Param("req") FxPersonAccountVo fxPersonAccountVo);

	List<FxPersonAccountVo> ExportExcelPerson();
}
